// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.

.forum-item {
  @_top: forum-item;
  @_content-margin: 5px;

  padding: @_content-margin (@forum-item-overflow - @_content-margin);
  margin: 2px -@forum-item-overflow;
  display: flex;
  transition: @forum-item-animate;

  .default-border-radius();
  background-color: var(--forum-item-background-color);
  font-size: @font-size--normal;
  position: relative;
  --latest-post-colour: hsl(var(--hsl-c2));

  &:hover {
    background-color: var(--forum-item-background-color-hover);
  }

  @media @desktop {
    margin-left: -@forum-item-overflow-desktop;
    margin-right: -@forum-item-overflow-desktop;
    padding-left: (@forum-item-overflow-desktop - @_content-margin);
    padding-right: (@forum-item-overflow-desktop - @_content-margin);
  }

  &--header {
    background: initial;
    padding-top: 0;
    padding-bottom: 0;
    --latest-post-colour: inherit;

    &:hover {
      background: initial;
    }
  }

  &__arrow {
    font-size: 14px; // icon size
    margin: @_content-margin;
    align-self: center;
    flex: none;

    @media @desktop {
      display: none;
    }
  }

  &__description {
    color: @osu-colour-c2;
  }

  &__details {
    margin: @_content-margin;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;

    @media @desktop {
      will-change: transform;
      transform: @forum-item-animate;
    }
  }

  &__latest-post {
    margin: @_content-margin;
    flex-direction: column;
    justify-content: center;
    color: var(--latest-post-colour);
    flex: none;
    width: 300px;
    display: none;

    @media @desktop {
      display: flex;
    }
  }

  &__name {
    font-size: @font-size--title-small-4;
    font-weight: 400;
    color: @osu-colour-c1;
    width: max-content;
    max-width: 100%;

    .link-hover({
      color: @osu-colour-c1;
    });
  }

  &__subforum {
    white-space: nowrap;
    margin: 2px 10px; // see __subforums
  }

  &__subforum-icon {
    margin-right: 2px;
  }

  &__subforums {
    list-style: none;
    padding: 0;
    margin: 8px -10px -2px;
    flex-wrap: wrap;
    display: none;

    @media @desktop {
      display: flex;
    }
  }
}
